#include <iostream>
#include <ostream>
//
// Created by lingzhitech on 25-9-26.
//
void fcn4() {
    size_t v1 = 42; // local variable
    // v1 is a reference to a non const variable
    // we can change that variable through the reference inside f2
    auto f2 = [&v1] { return ++v1; };
    v1 = 0;
    auto j = f2(); // j is 1
    std::cout << j << std::endl;
}

int main() {
    fcn4();
}
